<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function Game(name) {
            this.name = name
        }
        Game.prototype.play = function() {
            console.log('欢迎进入' + this.name)
        }

        function Map(mapName, num) {
            this.mapName = mapName
            this.num = num
        }

        function Role(roleName, hit, sex) {
            this.roleName = roleName
            this.hit = hit
            this.sex = sex
            Map.call(this, '召唤师峡谷', 3)
        }
        Role.prototype = new Game('英雄联盟')
        Role.prototype.constructor = Role

        let role = new Role('李白', '70', '男')
            // console.log(role);
        role.play()
    </script>
</body>

</html>